﻿using System;
using System.Drawing;

namespace sinetd.Utilities
{
    public class Assembly
    {
        public static Icon GetIconLarge(string libName, int index)
        {
            //int numIcons = 1;
            //IntPtr[] largeIcon = new IntPtr[numIcons];
            //IntPtr[] smallIcon = new IntPtr[numIcons];
            //Shell32.ExtractIconEx(libName, index, largeIcon, smallIcon, numIcons);
            //return Icon.FromHandle(largeIcon[0]);
			return Icon.ExtractAssociatedIcon(libName);
        }

        public static Icon GetIconSmall(string libName, int index)
        {
            //int numIcons = 1;
            //IntPtr[] largeIcon = new IntPtr[numIcons];
            //IntPtr[] smallIcon = new IntPtr[numIcons];
            //Shell32.ExtractIconEx(libName, index, largeIcon, smallIcon, numIcons);
            //return Icon.FromHandle(smallIcon[0]);
			return Icon.ExtractAssociatedIcon(libName);
        }
    }
}
